﻿using System;
using System.Collections.Generic;


namespace Qetza.TeamFoundation.WorkItemQuery.Admin
{
    /// <summary>
    /// Defines the contract that a parameter validator must implement.
    /// </summary>
    public interface IParameterValidator
    {
        #region Methods

        /// <summary>
        /// Validates the specified parameters based on the specified allowed parameters.
        /// </summary>
        /// <param name="specifiedParameters">
        /// The parameters to validate.
        /// </param>
        /// <param name="allowedParameters">
        /// The allowed parameters.
        /// </param>
        /// <param name="customValidation">
        /// A custom validation delegate.
        /// </param>
        void Validate(
            IDictionary<string, string> specifiedParameters, 
            IEnumerable<ParameterInfo> allowedParameters,
            Action<IDictionary<string, string>> customValidation
            );

        /// <summary>
        /// Returns the parameters syntax.
        /// </summary>
        /// <param name="parameters">
        /// The allowed parameters.
        /// </param>
        /// <returns>
        /// The parameters help string.
        /// </returns>
        string GetSyntax(IEnumerable<ParameterInfo> parameters);

        #endregion
    }
}
